﻿<?php include("conn.php") ?>
<?php
	$Type=$_GET["Type"];
	$title=$_POST["title"];
	if($Type=="Up"){
		if($title==""){
			OutErrorBack("网站名称不能够为空!");
		}

		$title = $_POST["title"];
		$is_open = $_POST["is_open"];
		$SiteDescription = trim($_POST["SiteDescription"]);
		$SiteKeywords = trim($_POST["SiteKeywords"]);
		$weburl = $_POST["weburl"];
		$copyright = $_POST["copyright"];
		$icp = trim($_POST["icp"]);
		$commonjs = trim($_POST["commonjs"]);
		$company = trim($_POST["company"]);
		$tel = $_POST["tel"];
		$address = $_POST["address"];
		$logo = trim($_POST["logo"]);
		$wxtitle = trim($_POST["wxtitle"]);
		$wxtoken = trim($_POST["wxtoken"]);
		$wxappid = trim($_POST["wxappid"]);
		$wxsecret = trim($_POST["wxsecret"]);
        $appappid = trim($_POST["appappid"]);
        $appsecret = trim($_POST["appsecret"]);
		$sql = "UPDATE `web_setting` SET title='$title',SiteDescription='$SiteDescription',SiteKeywords='$SiteKeywords',weburl='$weburl',copyright='$copyright',icp='$icp',commonjs='$commonjs',company='$company',tel='$tel',address='$address',logo='$logo',wxtitle='$wxtitle',wxtoken='$wxtoken',wxappid='$wxappid',wxsecret='$wxsecret',appappid='$appappid',appsecret='$appsecret' where id = '1'";
		$conn=new Mysql();
		if($conn->query($sql)){
			OutErrorGo("网站信息修改成功!","system-base.php");
			}else{
			
			OutErrorGo("网站信息修改失败!","system-base.php");	
				}
		
		
	}

?>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<?php include("public/cssjs.php");?>
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--/meta 作为公共模版分离出去-->
<title>基本设置</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	系统管理
	<span class="c-gray en">&gt;</span>
	基本设置
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<?php
$conn=new Mysql();
$rs =$conn->getRow("select * from web_setting where id=1");
if($rs)
{
?>
<div class="page-container">
	<form class="form form-horizontal" id="form-article-add" name="form1" action="?Type=Up" method="post">
		<div id="tab-system" class="HuiTab">
			<div class="tabBar cl">
				<span>网站设置</span>
				<span>信息设置</span>
				<span>图片设置</span>
				<span>其他设置</span>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						网站名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="website-title" placeholder="控制在25个字、50个字节以内" value="<?=$rs["title"]?>" class="input-text" name="title">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						关键词：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="website-Keywords" placeholder="5个左右,8汉字以内,用英文,隔开" value="<?=$rs["SiteKeywords"]?>" class="input-text" name="SiteKeywords">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						描述：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="website-description" placeholder="空制在80个汉字，160个字符以内" value="<?=$rs["SiteDescription"]?>" class="input-text"  name="SiteDescription">
					</div>
				</div>
				<div class="row cl" style="display:none">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						网站开启：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="checkbox" value="1" name="isopen" id="is_open"> 
					</div>
				</div>
				
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						<span class="c-red">*</span>
						底部版权信息：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="website-copyright" placeholder="&copy; 2016 H-ui.net" value="<?=$rs["copyright"]?>" class="input-text" name="copyright">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">备案号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="website-icp" placeholder="京ICP备00000000号" value="<?=$rs["icp"]?>" class="input-text" name="icp">
					</div>
				</div><div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">网站域名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="weburl" placeholder="http://www.ckxdwl.com/" value="<?=$rs["weburl"]?>" class="input-text" name="weburl">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">统计代码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="commonjs"><?=$rs["commonjs"]?></textarea>
					</div>
				</div>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">公司名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="company" id="company"><?=$rs["company"]?></textarea>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">公司电话：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="<?=$rs["tel"]?>" id="tel" name="tel" >
					</div>
				</div>
                <div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">公司地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?=$rs["address"]?>" id="address" name="address">
					</div>
				</div>
			</div>
			<div class="tabCon">
				
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">LOGO：</label>
					<div class="formControls col-xs-8 col-sm-9">
                       	<span class="btn-upload form-group">
                        <iframe src="../pic/images_UP.php?bd=logo&form=form1" name="key" width="648" height="30" marginheight="0" scrolling="No" frameborder="0" id="key">IE</iframe>
                        </span>
                        <input type="text" name="logo" class="input-text"   value="<?=$rs["logo"]?>" size="60">
                        <? if($rs["logo"]!=""){ echo "<img src='/pic/".$rs["logo"]."'>";}?>
                    	</div>
                    </div>
				</div>
				
			
			<div class="tabCon">
            <div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">微信商户号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="wxtitle" name="wxtitle" value="<?=$rs["wxtitle"]?>" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">微信key：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="wxtoken" name="wxtoken" value="<?=$rs["wxtoken"]?>" class="input-text">
					</div>
				</div>
            <div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">微信appid：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="wxappid" name="wxappid" value="<?=$rs["wxappid"]?>" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">微信serect：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="wxsecret" name="wxsecret"  value="<?=$rs["wxsecret"]?>">
					</div>
				</div>
                <div class="row cl hidden">
                    <label class="form-label col-xs-4 col-sm-2">小程序-appid：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" id="wxappid" name="appappid" value="<?=$rs["appappid"]?>" >
                    </div>
                </div>
                <div class="row cl hidden">
                    <label class="form-label col-xs-4 col-sm-2">小程序-serect：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" id="wxsecret" name="appsecret"  value="<?=$rs["appsecret"]?>">
                    </div>
                </div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
<?
}
?>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/h-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/h-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>


<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#tab-system").Huitab({
		index:0
	});
	$("#btn-star").click(function(){
		var files=$("#file-2").val();
		$.get("json/upload.php?files="+files,function(data){
			alert(data);
			})
		})
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
